﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Wsitech.BLL;
using System.Collections;

public partial class News_Report : System.Web.UI.Page
{
    protected readonly string sitemapid = HttpContext.Current.Request["sitemapid"] ?? "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            AspNetPager1.PageSize = 10;
            bindReport();
        }
    }

    private void bindReport()
    {
        int year = 0;

        if (Request["year"] != null)
        {
            try
            {
                year = int.Parse(Request["year"]);
            }
            catch (Exception)
            {
            }
        }

        int count = 0;
        repMain.DataSource = TextInfoBLL.Instance.GetActivePagedReportBySiteMapID(sitemapid, year, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, ref count);
        repMain.DataBind();

        AspNetPager1.RecordCount = count;
    }

    //换页
    protected void AspNetPager1_PageChanged(object sender, EventArgs e)
    {
        bindReport();
    }
}